#include <iostream>

#include "iostream"
#include "vector"
#include "unordered_map"
#include "unordered_set"
#include "algorithm"
#include "string"
#include "list"
#include "string.h"



class OneLoop {
public:
    std::vector<std::vector<int>> graph;
    std::vector<int> arrive;
    int cnt=0;
    void dfs(int cur_node,int depth){
        if(depth==3){
            if(arrive[3]==arrive[0]){
                cnt++;
            }
            return;
        }
        for(int i=0;i<graph.size();i++){
            if(graph[i][cur_node]){
                arrive[depth+1]=i;
                dfs(i,depth+1);
            }
        }
    }
    bool run(
            int a,int b
    ) {
        arrive.resize(4);
        std::vector<int> line(a);
        for(int i=0;i<a;i++){
            graph.push_back(line);
        }
        for(int i=0;i<b;i++){
            int n,m;std::cin>>n>>m;
            graph[n-1][m-1]=1;
            graph[m-1][n-1]=1;
        }
        for(int i=0;i<a;i++){
            arrive[0]=i;
            dfs(i,0);
        }
        printf("%d\n",cnt);
        return true;
    }
};

class Solution {
public:
    void run() {

        bool first = true;
        int a, b, c, d, e;
        //        std::cin >> a;
//        std::string s1,s2;
//        while (1){
        while (std::cin>>a>>b) {
//            std::getline(std::cin,s2);
            OneLoop l;
            if (!l.run(a,b)) {
//                                return;
            }
        }


    }
};

int main() {

    //    bool cur_num= true;
    Solution().run();
    return 0;
}

